#ifndef __TBUTTON_H__
#define __TBUTTON_H__

#include <gtk/gtk.h>

class tButton {
	public:
		gint x,y; //button's start x and y
		void change_image(const char *filename); //change button's image
		static gboolean release_tbutton(tButton *tbutton); //release button event
		static gboolean leave_tbutton(tButton *tbutton); //leave button event
		static gboolean press_tbutton(tButton *tbutton); //press button event
		static gboolean enter_tbutton(tButton *tbutton); //enter button event
		gboolean create_tbutton(GtkWidget *fixed,const char *filename,void (*runFunc)(gpointer),gpointer funcData);
		void set_mousein(gboolean s) { mousein = s; }
		gboolean get_mousein() { return mousein; }
		
		void do_clicked();
		void set_crood_xy(gint _x,gint _y){ x= _x;y = _y;}

		tButton();
		~tButton();

	private:
		GtkWidget *event;
		GtkWidget *image;
		GdkPixbuf *pix_n,*pix_p,*pix_e;
		gboolean mousein;
		void (*func) (gpointer);
		gpointer data;
		gboolean init(const char *filename,GtkWidget *fixed);
};

#endif
